const app = getApp();
var config = app.globalData.config;
const http = require('../../utils/http.js');
var WxParse = require('../../wxParse/wxParse.js');

Page({
  data: {
    message_id:0,
    dataList:[]
  },
  onLoad(options) {
    var message_id = options.id;

    this.setData({
      message_id:message_id
    });

    this.getMessageDetail();
  },
  getMessageDetail(){
    var that = this;
		http.httpPost(config.getMessageDetail, {
			message_id: that.data.message_id
		}, function(e) {
			if (e.code == 1) {
					that.setData({
						dataList: e.data
          });
          
          var _content = e.data.mdescribe;
          console.log(_content);
			    WxParse.wxParse('article', 'html', _content, that);
			}
		});
  },
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})